@extends('layouts.app')

@section('content')

<script type="text/javascript">  
function preImg(sourceId, targetId) {  
    if (typeof FileReader === 'undefined') {  
        alert('Your browser does not support FileReader...');  
        return;  
    }  
    var reader = new FileReader();  
  
    reader.onload = function(e) {  
        var img = document.getElementById(targetId);  
        img.src = this.result;  
    }  
    reader.readAsDataURL(document.getElementById(sourceId).files[0]); 
} 

</script>  

<form action="{{ url('setting/avatar') }}">  
    <input type="file" name="imgOne" id="imgOne" onchange="preImg(this.id,'imgPre');" />
    <div>
      <img id="imgPre" src="" style="display: block; width: 100px; height: 100px; boder-radius: 50px;" />
    </div>
    <button type="submit">提交</button>
</form>

@endsection